import request from "@/utils/request";

enum Api {
  getWechatMomentsUrl = "/event",
  getUsetinfoUrl = "/user/account",
  getNumberOfFansUrl = "/user/followeds",
  getUserAttentionUrl = "/user/follows",
  getUserDynamicsUrl = "/user/event",
}

/**
 *
 * @param pagesize  获取多少挑朋友圈
 * @returns
 */
// 请求获取朋友圈的接口
export const getWechatMomentsApi = (pagesize: number) => {
  return request.get<any, any>(Api.getWechatMomentsUrl, {
    params: {
      pagesize,
    },
  });
};

/**
 *
 * @returns  any
 */
// 请求用户信息的接口
export const getUsetinfoApi = () => {
  return request.get<any, any>(Api.getUsetinfoUrl);
};

/**
 *
 * @param uid  账号id
 * @returns  any
 */
// 获取账号的粉丝列表
export const getNumberOfFansApi = (uid: Number) => {
  return request.get<any, any>(Api.getNumberOfFansUrl, {
    params: {
      uid,
    },
  });
};

/**
 *
 * @param uid  账号id
 * @returns
 */
// 获取账号的关注列表
export const getUserAttentionApi = (uid: Number) => {
  return request.get<any, any>(Api.getUserAttentionUrl, {
    params: {
      uid,
    },
  });
};

export const getUserDynamicsApi = (
  uid: number,
  limit: number,
  lasttime: number
) => {
  return request.get<any, any>(Api.getUserDynamicsUrl, {
    params: {
      uid,
      limit,
      lasttime,
    },
  });
};
